package com.zhong.springcloud.controller;

import com.zhong.springcloud.Service.DeptClientService;
import com.zhong.springcloud.pojo.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;

import java.util.List;


@RestController
public class DeptConsumerController {

    @Autowired
    private DeptClientService deptClientService=null;


    @RequestMapping("/consumer/dept/add")
    public Boolean add(Dept dept){
        return deptClientService.addDept(dept);
    }

    @RequestMapping("/consumer/dept/get/{id}")
    public Dept get(@PathVariable("id") Long id){
        return deptClientService.queryById(id);
    }

    @RequestMapping("/consumer/dept/list")
    public List<Dept> queryall(){
        return deptClientService.queryAll();
    }
}
